//
//  UIImage+ImageEffects.h
//  RMEducation
//
//  Created by tongbinLi on 16/3/1.
//  Copyright © 2016年 tongbinLi. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIImage (ImageEffects)

- (UIImage *)applyLightEffect;
- (UIImage *)applyExtraLightEffect;
- (UIImage *)applyDarkEffect;
- (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor;

- (UIImage *)applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage;


- (UIImage*)imageCompressWithScaledToWidth:(CGFloat)width;

//图片转字符串
-(NSString *)UIImageToBase64Str;
-(NSString *)UIImageToBase64Str:(CGFloat)compressionQuality;

//字符串转图片
+(UIImage *)Base64StrToUIImage:(NSString *)_encodedImageStr;

+ (UIImage*) imageWithColor:(UIColor*)color andHeight:(CGFloat)height;

//图片加圆角
- (UIImage *)roundedCornerImageWithCornerRadius:(CGFloat)cornerRadius;

//图片转换为指定大小
- (UIImage *)imageByScalingToSize:(CGSize)targetSize;

//生成指定颜色, 指定大小的图片
+ (UIImage *)imageFromColor:(UIColor *)color size:(CGSize)size;

//根据图片获取图片的主色调
+(UIColor*)mostColor:(UIImage*)image;
@end

